/**
 * 2015，thor.com，all rights reserved。
 * 
 * Project：		thor-common
 * Filename：	QueryResultConverter.java
 * Created：		2015年3月14日
 * Creator：		thor
 */
package com.thor.palmmall.spi.common;

import org.springframework.core.convert.converter.Converter;

import com.thor.commons.entity.BeanOperator;

/**
 * @author thor
 *
 */
public class SOperatorConverter implements Converter<BeanOperator, SOperator> {

	public static SOperatorConverter getInstance() {
		if (instance == null)
			instance = new SOperatorConverter();
		return instance;
	}

	private static SOperatorConverter instance;

	private SOperatorConverter() {
	}

	@Override
	public SOperator convert(BeanOperator source) {
		if (source == null)
			return null;

		SOperator target = new SOperator();
		target.setFullName(source.getOperName());
		target.setId(source.getOperId());
		target.setNamespace("-");

		return target;
	}
}
